<template>
    <div class="task-my-issue-container">
        <Divider style="margin-bottom: 50px">我发布的任务</Divider>
        <Collapse simple>
            <Panel v-for="(item, index) in task_list" :key="`panel-${index}`" :name="`my-issue-${index}`">
                {{item.subject}}
                <div  class="t-m-i-item" style="float: right">
                    <div class="t-m-i-status">{{item.close == 1 ? "已截止" : "进行中"}}</div>
                    <div class="t-m-i-date">{{item.pubDate}} - {{item.deadLine}}</div>
                </div>
                <div slot="content" style="overflow: hidden; margin: 10px 0">
                    <Record_Details :task="item" />
                </div>
            </Panel>
        </Collapse>
    </div>
</template>

<script>

import task_request from "@/axios/task";
import Record_Details from "@task/vue/record-details";

export default {
    data() {
        return {
            task_list: []
        }
    },
    mounted() {
        this.queryTask();
    },
    methods: {
        async queryTask() {
            this.task_list = await task_request.queryTask(undefined, this.$store.state.user.sid);
        }
    },
    components: {
        Record_Details
    }
}
</script>

<style lang="scss">
@import "@task/scss/record-list.scss";
</style>